Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add renderFooter option in external field #684

Merged

Conversation

camhammel
Copy link
Contributor

@camhammel camhammel commented Nov 7, 2024

Description

Adds a new optional property to external fields, renderFooter. This property accepts a function resolving to a ReactElement in place of the default footer, with a prop provided for items representing the mappedData.

Screenshots

CleanShot 2024-11-07 at 12 31 32

Motivation

We're using the external field to allow the user to select an image from a set of images provided by our external service. We'd like to be able to display a "Manage Images" link in the footer to provide the user with a clear path to add/remove any of the image options displayed in the modal.

Copy link

vercel bot commented Nov 7, 2024

@camhammel is attempting to deploy a commit to the Measured Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Nov 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
puck-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 14, 2024 4:06pm
puck-docs ✅ Ready (Inspect) Visit Preview Nov 14, 2024 4:06pm

@camhammel camhammel changed the title feat: add render footer in external field feat: add renderFooter option in external field Nov 7, 2024
Copy link
Member

@chrisvxd chrisvxd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another excellent feature addition, thank you!

Left some comments.

packages/core/types/Fields.ts Outdated Show resolved Hide resolved
packages/core/components/ExternalInput/index.tsx Outdated Show resolved Hide resolved
Copy link
Member

@chrisvxd chrisvxd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the comments! Almost perfect now, just spotted one final nit

Copy link
Member

@chrisvxd chrisvxd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Think I'm actually gonna go ahead and merge this and your other one, so a canary should be released shortly.

@chrisvxd chrisvxd merged commit ccec96e into measuredco:main Nov 14, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants